package com.kly.chatter.api.application;

import com.alibaba.nacos.spring.context.annotation.config.NacosPropertySource;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.XADataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.ImportResource;
import org.springframework.scheduling.annotation.EnableScheduling;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

/**
 * Created with IntelliJ IDEA.
 * User: yujianfu (mr.vencnet@gmail.com)
 * Date: 2018/8/15
 * Time: 下午8:03
 */
@ComponentScan(basePackages = {
        "com.kly", "com.kly.chatter.api.application.swagger"
})
@ImportResource({
        "classpath*:app-redis.xml",
        "classpath*:amazon-s3-service.xml",
        "classpath:dubbo-consumer.xml",
        "classpath:message-context.xml",
        "classpath*:mybatis-config.xml",
        "classpath*:spring-datasource.xml"
})
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
@ServletComponentScan(basePackageClasses = {com.fqgj.log.filter.TraceFilter.class})
@NacosPropertySource(dataId = "chatter-api", autoRefreshed = true)
@EnableSwagger2
@EnableScheduling
public class ApiApplication {
    public static void main(String[] args) {
        SpringApplication.run(ApiApplication.class, args);
    }
}
